package com.chen.base.module.mybatis.component;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
import com.chen.base.module.mybatis.methods.InsertAllOracle;
import com.chen.base.module.mybatis.methods.SelectSinglyColumnList;

import java.util.List;

/**
 * 支持自定义数据权限方法注入
 *
 * @author ChenJinLong
 * @date 2023-06-21
 */
public class DataScopeSqlInjector extends DefaultSqlInjector {

	@Override
	public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
		List<AbstractMethod> methodList = super.getMethodList(mapperClass,tableInfo);
		// 扩展通用Mapper函数
		methodList.add(new InsertBatchSomeColumn());
		methodList.add(new SelectSinglyColumnList());
		methodList.add(new InsertAllOracle());
		return methodList;
	}

}